﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace Online_Shop
{
    public class cl_0423_TemplateFactory
    {
        private ArrayList stores = new ArrayList();
        private int totalTerminal=0;

        public cl_0423_TemplateFactory()
        {
            cl_0423_StoreTemplate st1=new cl_0423_ClothStore("服装店");
            stores.Add(st1);
            cl_0423_StoreTemplate st2 = new cl_0423_SnackStore("零食店");
            stores.Add(st2);
        }

        public cl_0423_StoreTemplate getStores(string type)
        {
            if (type.Equals("服装店")) {
                totalTerminal++;
                return (cl_0423_StoreTemplate)stores[0];
            }
            else if (type.Equals("零食店"))
            {
                totalTerminal++;
                return (cl_0423_StoreTemplate)stores[1];
            }
            return null;
        }

        public int getTotaltype()
        {
            return stores.Count;
        }

        public int getTotalstore()
        {
            return totalTerminal;
        }
    }
}